/******************************************************************
 * This program was written as part of
 *   Assignment 4
 *   Computer Graphics                                             
 *   Semester 1, 2013
 *   School of Computer Science,
 *   The University of Adelaide
 *                                                                          
 * I declare that all material in this assessment is my own work except where
 * there is clear acknowledgement and reference to the work of others. I have
 * read the University Policy Statement on Plagiarism, Collusion and Related
 * Forms of Cheating:  

 * http://www.adelaide.edu.au/policies/?230

 * I give permission for my assessment work, including my subversion
 * repository, to be reproduced and submitted to academic staff for the
 * purposes of assessment and to be copied, submitted and retained in a form
 * suitable for electronic checking of plagiarism.  
                            
 * Authors:
 *  Terry Moschou    a1208955
 *  Salih Al-Rashid  a1210108
 *  Ben McAleer      a1212203
*******************************************************************/

#ifndef TERRAIN
#define TERRAIN

#include "Common.hpp"
#include "Object.hpp"
#include "UserInterface.hpp"
#include "Model.hpp"

class Terrain : public Object
{
public:
  Terrain(Object * parent, Model * model, int rows, int cols);
  
  float getHeight(float x, float z);
  Object* near(vec3 pos, const std::string & objname);
  bool free(vec3 pos);
  
  int offset(int horizontal, int vertical);
  int m_rows;
  int m_cols;
  float* m_terrainArray;
  Object * m_field;
  
  Box m_box;
  Object * m_collision;
  bool goforit;
  
};
#endif


